package cn.jinjie.day09;

import java.util.*;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class Test05 {
    public static void main(String[] args) {
        //四种生成stream流的方式
        //1.集合
        Collection<String> coll = new ArrayList<>();
        Stream<String> s1 = coll.stream();

        //2.容器 取出map里面的set集合再获取
        Map<String, String> map = new HashMap<>();
        Set<String> set1 = map.keySet();//获取所有的key
        Stream<String> s2 = set1.stream();

        //3.数组
        int[] arr = new int[5];
        IntStream s3 = Arrays.stream(arr);

        //4.同种数据类型的多个数据 底层还是数组 直接得到stream流
        Stream<Integer> s4 = Stream.of(1, 2, 3, 4);
        //一个stream流对象只能操作一次



    }
}
